<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
  <div class="w790">
     <div class="table_"><table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
 <thead>
 <tr>
    <td align="center">ID</td>
    <td align="center">留言人</td>
    <td align="center">标题</td>
    <td align="center">内容</td>
    <td align="center">联系电话</td>
    <td align="center">QQ</td>
    <td align="center">审核</td>
    <td align="center">时间</td>
    <td align="center">操作</td>
  </tr>
</thead>

<volist name="list" id="vo"> 
  <tr class="data_list">
    <td align="center"><input type="checkbox" name="id" id="id" class="sall" value="{$vo.id}" />{$vo.id}</td>
    <td>{$vo.yourname}<notempty name="vo['openid']">({$vo.openid})<input type="checkbox" name="id" id="id" class="sallMember_id" value="{$vo.member_id}" /></notempty></td>
    <td>{$vo.title}</td>
    <td>{$vo.content}</td>
    <td>{$vo.tel}</td>
    <td>{$vo.QQ}</td>
    <td align="center"><eq name="vo['status']" value="1"><span class="status1 status_btn" field="status,{$vo.id}"></span><else/><span class="status0 status_btn" field="status,{$vo.id}"></span></eq></td>
    <td align="center">{:date('Y-m-d H:i:s',$vo['datetime'])}</td>
    <td align="center"><a href="{:U('edit',array('id'=>$vo['id']))}">查看</a> | <a href="{:U('delete',array('id'=>$vo['id']))}" onclick="return confirm('您确定要删除这条记录吗？');">删除</a></td>
  </tr>
</volist>
 <div class="pages">
        <div class="controlList fl"><a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="sall();"><i class="glyphicon glyphicon-check"></i> 全选/反选</a> <a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="rall();"><i class="glyphicon glyphicon-unchecked"></i> 全不选</a> <a class="btn btn-danger btn-sm" href="javascript:void(0);" onclick="delall();"><i class="glyphicon glyphicon-trash"></i> 删除选中</a> <a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="update_sort('id','sort','','{:U('dosort')}');"><i class="glyphicon glyphicon-refresh"></i> 更新排序</a> 
游戏<select id="MagicListId">
    <volist name="MagicList" id="vo">
    <option value="{$vo.id}">{$vo.title}</option>
    </volist>
    </select>选中会员分配<input type="text" id="number">次抽奖机会<button class="mybutton" onClick="sendnumber();">确定</button></td>
    </tr><tr>
    <td colspan="9"><div class="pages">{$pages}</div></td>
    </tr>
</table></div>

  </div>
  <div class="clear"></div>
</div><script>	
	function sendnumber(){
		var ids=new Array();
		$('.sallMember_id').each(function(index, element) {
            if($(this).attr('checked')=='checked'){
				ids.push($(this).val());
			}
        });
		if(!ids.length>0){
			error('至少选择一个对象');
			return false;
		}
		var number = $('#number').val();
		var magic_id = $('#MagicListId').val();
		$.post('{:U('Magicuseraddnumber/insert')}',{aid:ids.toString(),number:number,magic_id:magic_id},function(data){
			if(data.status == 1){
				success(data.info);
			}else{
				error(data.info);
			}
		},'json');
	}
</script>
<include file="Public:footer" />